package com.qf.smsplatform.webmaster.controller.swagger;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2//开启 swaager
public class SwaggerConfig {

    @Bean
    public ApiInfo apiInfo() {
            return  new ApiInfoBuilder()
                    .version("2.1.0.alpha")
                    .description("上分是啥撒开发商")
                    .title("了看过的")
                    .license("apache2.0")
                    .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0")
                    .contact(new Contact("暗杀教室发售","kgasfkfhaslda.com","jsadfg@sda.com"))
                    .build();
    }

    @Bean
    public Docket docket(ApiInfo apiInfo) {
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo)
                .select().apis(RequestHandlerSelectors.basePackage("com.qf.smsplatform.webmaster.controller")).build();
    }
}
